/*+
 * Copyright (c) 2022-2024 Zhengde
 * 
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * 1 Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 * 
 * 2 Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 * 
 * 3 Neither the name of the copyright holder nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/

/*+
 * AXI4 bus matrix with 4 master ports and 6 slave ports
 * TODO: replace shared bus with crossbar for high performance
-*/

module axi4_m4s6
(
    // Inputs
    input           clk               ,
    input           rst_n             ,

    input           mst0_awvalid_i    ,
    input  [ 31:0]  mst0_awaddr_i     ,
    input  [  3:0]  mst0_awid_i       ,
    input  [  7:0]  mst0_awlen_i      ,
    input  [  1:0]  mst0_awburst_i    ,
    input           mst0_wvalid_i     ,
    input  [ 31:0]  mst0_wdata_i      ,
    input  [  3:0]  mst0_wstrb_i      ,
    input           mst0_wlast_i      ,
    input           mst0_bready_i     ,
    input           mst0_arvalid_i    ,
    input  [ 31:0]  mst0_araddr_i     ,
    input  [  3:0]  mst0_arid_i       ,
    input  [  7:0]  mst0_arlen_i      ,
    input  [  1:0]  mst0_arburst_i    ,
    input           mst0_rready_i     ,

    input           mst1_awvalid_i    ,
    input  [ 31:0]  mst1_awaddr_i     ,
    input  [  3:0]  mst1_awid_i       ,
    input  [  7:0]  mst1_awlen_i      ,
    input  [  1:0]  mst1_awburst_i    ,
    input           mst1_wvalid_i     ,
    input  [ 31:0]  mst1_wdata_i      ,
    input  [  3:0]  mst1_wstrb_i      ,
    input           mst1_wlast_i      ,
    input           mst1_bready_i     ,
    input           mst1_arvalid_i    ,
    input  [ 31:0]  mst1_araddr_i     ,
    input  [  3:0]  mst1_arid_i       ,
    input  [  7:0]  mst1_arlen_i      ,
    input  [  1:0]  mst1_arburst_i    ,
    input           mst1_rready_i     ,

    input           mst2_awvalid_i    ,
    input  [ 31:0]  mst2_awaddr_i     ,
    input  [  3:0]  mst2_awid_i       ,
    input  [  7:0]  mst2_awlen_i      ,
    input  [  1:0]  mst2_awburst_i    ,
    input           mst2_wvalid_i     ,
    input  [ 31:0]  mst2_wdata_i      ,
    input  [  3:0]  mst2_wstrb_i      ,
    input           mst2_wlast_i      ,
    input           mst2_bready_i     ,
    input           mst2_arvalid_i    ,
    input  [ 31:0]  mst2_araddr_i     ,
    input  [  3:0]  mst2_arid_i       ,
    input  [  7:0]  mst2_arlen_i      ,
    input  [  1:0]  mst2_arburst_i    ,
    input           mst2_rready_i     ,

    input           mst3_awvalid_i    ,
    input  [ 31:0]  mst3_awaddr_i     ,
    input  [  3:0]  mst3_awid_i       ,
    input  [  7:0]  mst3_awlen_i      ,
    input  [  1:0]  mst3_awburst_i    ,
    input           mst3_wvalid_i     ,
    input  [ 31:0]  mst3_wdata_i      ,
    input  [  3:0]  mst3_wstrb_i      ,
    input           mst3_wlast_i      ,
    input           mst3_bready_i     ,
    input           mst3_arvalid_i    ,
    input  [ 31:0]  mst3_araddr_i     ,
    input  [  3:0]  mst3_arid_i       ,
    input  [  7:0]  mst3_arlen_i      ,
    input  [  1:0]  mst3_arburst_i    ,
    input           mst3_rready_i     ,

    input           slv0_awready_i    ,
    input           slv0_wready_i     ,
    input           slv0_bvalid_i     ,
    input  [  1:0]  slv0_bresp_i      ,
    input  [  3:0]  slv0_bid_i        ,
    input           slv0_arready_i    ,
    input           slv0_rvalid_i     ,
    input  [ 31:0]  slv0_rdata_i      ,
    input  [  1:0]  slv0_rresp_i      ,
    input  [  3:0]  slv0_rid_i        ,
    input           slv0_rlast_i      ,

    input           slv1_awready_i    ,
    input           slv1_wready_i     ,
    input           slv1_bvalid_i     ,
    input  [  1:0]  slv1_bresp_i      ,
    input  [  3:0]  slv1_bid_i        ,
    input           slv1_arready_i    ,
    input           slv1_rvalid_i     ,
    input  [ 31:0]  slv1_rdata_i      ,
    input  [  1:0]  slv1_rresp_i      ,
    input  [  3:0]  slv1_rid_i        ,
    input           slv1_rlast_i      ,

    input           slv2_awready_i    ,
    input           slv2_wready_i     ,
    input           slv2_bvalid_i     ,
    input  [  1:0]  slv2_bresp_i      ,
    input  [  3:0]  slv2_bid_i        ,
    input           slv2_arready_i    ,
    input           slv2_rvalid_i     ,
    input  [ 31:0]  slv2_rdata_i      ,
    input  [  1:0]  slv2_rresp_i      ,
    input  [  3:0]  slv2_rid_i        ,
    input           slv2_rlast_i      ,

    input           slv3_awready_i    ,
    input           slv3_wready_i     ,
    input           slv3_bvalid_i     ,
    input  [  1:0]  slv3_bresp_i      ,
    input  [  3:0]  slv3_bid_i        ,
    input           slv3_arready_i    ,
    input           slv3_rvalid_i     ,
    input  [ 31:0]  slv3_rdata_i      ,
    input  [  1:0]  slv3_rresp_i      ,
    input  [  3:0]  slv3_rid_i        ,
    input           slv3_rlast_i      ,

    input           slv4_awready_i    ,
    input           slv4_wready_i     ,
    input           slv4_bvalid_i     ,
    input  [  1:0]  slv4_bresp_i      ,
    input  [  3:0]  slv4_bid_i        ,
    input           slv4_arready_i    ,
    input           slv4_rvalid_i     ,
    input  [ 31:0]  slv4_rdata_i      ,
    input  [  1:0]  slv4_rresp_i      ,
    input  [  3:0]  slv4_rid_i        ,
    input           slv4_rlast_i      ,

    input           slv5_awready_i    ,
    input           slv5_wready_i     ,
    input           slv5_bvalid_i     ,
    input  [  1:0]  slv5_bresp_i      ,
    input  [  3:0]  slv5_bid_i        ,
    input           slv5_arready_i    ,
    input           slv5_rvalid_i     ,
    input  [ 31:0]  slv5_rdata_i      ,
    input  [  1:0]  slv5_rresp_i      ,
    input  [  3:0]  slv5_rid_i        ,
    input           slv5_rlast_i      ,

    // Outputs
    output          mst0_awready_o    ,
    output          mst0_wready_o     ,
    output          mst0_bvalid_o     ,
    output [  1:0]  mst0_bresp_o      ,
    output [  3:0]  mst0_bid_o        ,
    output          mst0_arready_o    ,
    output          mst0_rvalid_o     ,
    output [ 31:0]  mst0_rdata_o      ,
    output [  1:0]  mst0_rresp_o      ,
    output [  3:0]  mst0_rid_o        ,
    output          mst0_rlast_o      ,

    output          mst1_awready_o    ,
    output          mst1_wready_o     ,
    output          mst1_bvalid_o     ,
    output [  1:0]  mst1_bresp_o      ,
    output [  3:0]  mst1_bid_o        ,
    output          mst1_arready_o    ,
    output          mst1_rvalid_o     ,
    output [ 31:0]  mst1_rdata_o      ,
    output [  1:0]  mst1_rresp_o      ,
    output [  3:0]  mst1_rid_o        ,
    output          mst1_rlast_o      ,

    output          mst2_awready_o    ,
    output          mst2_wready_o     ,
    output          mst2_bvalid_o     ,
    output [  1:0]  mst2_bresp_o      ,
    output [  3:0]  mst2_bid_o        ,
    output          mst2_arready_o    ,
    output          mst2_rvalid_o     ,
    output [ 31:0]  mst2_rdata_o      ,
    output [  1:0]  mst2_rresp_o      ,
    output [  3:0]  mst2_rid_o        ,
    output          mst2_rlast_o      ,

    output          mst3_awready_o    ,
    output          mst3_wready_o     ,
    output          mst3_bvalid_o     ,
    output [  1:0]  mst3_bresp_o      ,
    output [  3:0]  mst3_bid_o        ,
    output          mst3_arready_o    ,
    output          mst3_rvalid_o     ,
    output [ 31:0]  mst3_rdata_o      ,
    output [  1:0]  mst3_rresp_o      ,
    output [  3:0]  mst3_rid_o        ,
    output          mst3_rlast_o      ,

    output          slv0_awvalid_o    ,
    output [ 31:0]  slv0_awaddr_o     ,
    output [  3:0]  slv0_awid_o       ,
    output [  7:0]  slv0_awlen_o      ,
    output [  1:0]  slv0_awburst_o    ,
    output          slv0_wvalid_o     ,
    output [ 31:0]  slv0_wdata_o      ,
    output [  3:0]  slv0_wstrb_o      ,
    output          slv0_wlast_o      ,
    output          slv0_bready_o     ,
    output          slv0_arvalid_o    ,
    output [ 31:0]  slv0_araddr_o     ,
    output [  3:0]  slv0_arid_o       ,
    output [  7:0]  slv0_arlen_o      ,
    output [  1:0]  slv0_arburst_o    ,
    output          slv0_rready_o     ,

    output          slv1_awvalid_o    ,
    output [ 31:0]  slv1_awaddr_o     ,
    output [  3:0]  slv1_awid_o       ,
    output [  7:0]  slv1_awlen_o      ,
    output [  1:0]  slv1_awburst_o    ,
    output          slv1_wvalid_o     ,
    output [ 31:0]  slv1_wdata_o      ,
    output [  3:0]  slv1_wstrb_o      ,
    output          slv1_wlast_o      ,
    output          slv1_bready_o     ,
    output          slv1_arvalid_o    ,
    output [ 31:0]  slv1_araddr_o     ,
    output [  3:0]  slv1_arid_o       ,
    output [  7:0]  slv1_arlen_o      ,
    output [  1:0]  slv1_arburst_o    ,
    output          slv1_rready_o     ,

    output          slv2_awvalid_o    ,
    output [ 31:0]  slv2_awaddr_o     ,
    output [  3:0]  slv2_awid_o       ,
    output [  7:0]  slv2_awlen_o      ,
    output [  1:0]  slv2_awburst_o    ,
    output          slv2_wvalid_o     ,
    output [ 31:0]  slv2_wdata_o      ,
    output [  3:0]  slv2_wstrb_o      ,
    output          slv2_wlast_o      ,
    output          slv2_bready_o     ,
    output          slv2_arvalid_o    ,
    output [ 31:0]  slv2_araddr_o     ,
    output [  3:0]  slv2_arid_o       ,
    output [  7:0]  slv2_arlen_o      ,
    output [  1:0]  slv2_arburst_o    ,
    output          slv2_rready_o     ,

    output          slv3_awvalid_o    ,
    output [ 31:0]  slv3_awaddr_o     ,
    output [  3:0]  slv3_awid_o       ,
    output [  7:0]  slv3_awlen_o      ,
    output [  1:0]  slv3_awburst_o    ,
    output          slv3_wvalid_o     ,
    output [ 31:0]  slv3_wdata_o      ,
    output [  3:0]  slv3_wstrb_o      ,
    output          slv3_wlast_o      ,
    output          slv3_bready_o     ,
    output          slv3_arvalid_o    ,
    output [ 31:0]  slv3_araddr_o     ,
    output [  3:0]  slv3_arid_o       ,
    output [  7:0]  slv3_arlen_o      ,
    output [  1:0]  slv3_arburst_o    ,
    output          slv3_rready_o     ,

    output          slv4_awvalid_o    ,
    output [ 31:0]  slv4_awaddr_o     ,
    output [  3:0]  slv4_awid_o       ,
    output [  7:0]  slv4_awlen_o      ,
    output [  1:0]  slv4_awburst_o    ,
    output          slv4_wvalid_o     ,
    output [ 31:0]  slv4_wdata_o      ,
    output [  3:0]  slv4_wstrb_o      ,
    output          slv4_wlast_o      ,
    output          slv4_bready_o     ,
    output          slv4_arvalid_o    ,
    output [ 31:0]  slv4_araddr_o     ,
    output [  3:0]  slv4_arid_o       ,
    output [  7:0]  slv4_arlen_o      ,
    output [  1:0]  slv4_arburst_o    ,
    output          slv4_rready_o     ,

    output          slv5_awvalid_o    ,
    output [ 31:0]  slv5_awaddr_o     ,
    output [  3:0]  slv5_awid_o       ,
    output [  7:0]  slv5_awlen_o      ,
    output [  1:0]  slv5_awburst_o    ,
    output          slv5_wvalid_o     ,
    output [ 31:0]  slv5_wdata_o      ,
    output [  3:0]  slv5_wstrb_o      ,
    output          slv5_wlast_o      ,
    output          slv5_bready_o     ,
    output          slv5_arvalid_o    ,
    output [ 31:0]  slv5_araddr_o     ,
    output [  3:0]  slv5_arid_o       ,
    output [  7:0]  slv5_arlen_o      ,
    output [  1:0]  slv5_arburst_o    ,
    output          slv5_rready_o     
);

    wire          arb_awvalid_w ;   
    wire [ 31:0]  arb_awaddr_w  ;   
    wire [  3:0]  arb_awid_w    ;   
    wire [  7:0]  arb_awlen_w   ;   
    wire [  1:0]  arb_awburst_w ;   
    wire          arb_wvalid_w  ;   
    wire [ 31:0]  arb_wdata_w   ;   
    wire [  3:0]  arb_wstrb_w   ;   
    wire          arb_wlast_w   ;   
    wire          arb_bready_w  ;   
    wire          arb_arvalid_w ;   
    wire [ 31:0]  arb_araddr_w  ;   
    wire [  3:0]  arb_arid_w    ;   
    wire [  7:0]  arb_arlen_w   ;   
    wire [  1:0]  arb_arburst_w ;   
    wire          arb_rready_w  ;   

    wire          arb_awready_w ;
    wire          arb_wready_w  ;
    wire          arb_bvalid_w  ;
    wire [  1:0]  arb_bresp_w   ;
    wire [  3:0]  arb_bid_w     ;
    wire          arb_arready_w ;
    wire          arb_rvalid_w  ;
    wire [ 31:0]  arb_rdata_w   ;
    wire [  1:0]  arb_rresp_w   ;
    wire [  3:0]  arb_rid_w     ;
    wire          arb_rlast_w   ;

    axi4_arb u_axi4_arb
    (
        // Inputs
        .clk                  (clk           ),
        .rst_n                (rst_n         ),
        .inport0_awvalid_i    (mst0_awvalid_i),
        .inport0_awaddr_i     (mst0_awaddr_i ),
        .inport0_awid_i       (mst0_awid_i   ),
        .inport0_awlen_i      (mst0_awlen_i  ),
        .inport0_awburst_i    (mst0_awburst_i),
        .inport0_wvalid_i     (mst0_wvalid_i ),
        .inport0_wdata_i      (mst0_wdata_i  ),
        .inport0_wstrb_i      (mst0_wstrb_i  ),
        .inport0_wlast_i      (mst0_wlast_i  ),
        .inport0_bready_i     (mst0_bready_i ),
        .inport0_arvalid_i    (mst0_arvalid_i),
        .inport0_araddr_i     (mst0_araddr_i ),
        .inport0_arid_i       (mst0_arid_i   ),
        .inport0_arlen_i      (mst0_arlen_i  ),
        .inport0_arburst_i    (mst0_arburst_i),
        .inport0_rready_i     (mst0_rready_i ),
        .inport1_awvalid_i    (mst1_awvalid_i),
        .inport1_awaddr_i     (mst1_awaddr_i ),
        .inport1_awid_i       (mst1_awid_i   ),
        .inport1_awlen_i      (mst1_awlen_i  ),
        .inport1_awburst_i    (mst1_awburst_i),
        .inport1_wvalid_i     (mst1_wvalid_i ),
        .inport1_wdata_i      (mst1_wdata_i  ),
        .inport1_wstrb_i      (mst1_wstrb_i  ),
        .inport1_wlast_i      (mst1_wlast_i  ),
        .inport1_bready_i     (mst1_bready_i ),
        .inport1_arvalid_i    (mst1_arvalid_i),
        .inport1_araddr_i     (mst1_araddr_i ),
        .inport1_arid_i       (mst1_arid_i   ),
        .inport1_arlen_i      (mst1_arlen_i  ),
        .inport1_arburst_i    (mst1_arburst_i),
        .inport1_rready_i     (mst1_rready_i ),
        .inport2_awvalid_i    (mst2_awvalid_i),
        .inport2_awaddr_i     (mst2_awaddr_i ),
        .inport2_awid_i       (mst2_awid_i   ),
        .inport2_awlen_i      (mst2_awlen_i  ),
        .inport2_awburst_i    (mst2_awburst_i),
        .inport2_wvalid_i     (mst2_wvalid_i ),
        .inport2_wdata_i      (mst2_wdata_i  ),
        .inport2_wstrb_i      (mst2_wstrb_i  ),
        .inport2_wlast_i      (mst2_wlast_i  ),
        .inport2_bready_i     (mst2_bready_i ),
        .inport2_arvalid_i    (mst2_arvalid_i),
        .inport2_araddr_i     (mst2_araddr_i ),
        .inport2_arid_i       (mst2_arid_i   ),
        .inport2_arlen_i      (mst2_arlen_i  ),
        .inport2_arburst_i    (mst2_arburst_i),
        .inport2_rready_i     (mst2_rready_i ),
        .inport3_awvalid_i    (mst3_awvalid_i),
        .inport3_awaddr_i     (mst3_awaddr_i ),
        .inport3_awid_i       (mst3_awid_i   ),
        .inport3_awlen_i      (mst3_awlen_i  ),
        .inport3_awburst_i    (mst3_awburst_i),
        .inport3_wvalid_i     (mst3_wvalid_i ),
        .inport3_wdata_i      (mst3_wdata_i  ),
        .inport3_wstrb_i      (mst3_wstrb_i  ),
        .inport3_wlast_i      (mst3_wlast_i  ),
        .inport3_bready_i     (mst3_bready_i ),
        .inport3_arvalid_i    (mst3_arvalid_i),
        .inport3_araddr_i     (mst3_araddr_i ),
        .inport3_arid_i       (mst3_arid_i   ),
        .inport3_arlen_i      (mst3_arlen_i  ),
        .inport3_arburst_i    (mst3_arburst_i),
        .inport3_rready_i     (mst3_rready_i ),
        .outport_awready_i    (arb_awready_w ),
        .outport_wready_i     (arb_wready_w  ),
        .outport_bvalid_i     (arb_bvalid_w  ),
        .outport_bresp_i      (arb_bresp_w   ),
        .outport_bid_i        (arb_bid_w     ),
        .outport_arready_i    (arb_arready_w ),
        .outport_rvalid_i     (arb_rvalid_w  ),
        .outport_rdata_i      (arb_rdata_w   ),
        .outport_rresp_i      (arb_rresp_w   ),
        .outport_rid_i        (arb_rid_w     ),
        .outport_rlast_i      (arb_rlast_w   ),
    
        // Outputs
        .inport0_awready_o    (mst0_awready_o),
        .inport0_wready_o     (mst0_wready_o ),
        .inport0_bvalid_o     (mst0_bvalid_o ),
        .inport0_bresp_o      (mst0_bresp_o  ),
        .inport0_bid_o        (mst0_bid_o    ),
        .inport0_arready_o    (mst0_arready_o),
        .inport0_rvalid_o     (mst0_rvalid_o ),
        .inport0_rdata_o      (mst0_rdata_o  ),
        .inport0_rresp_o      (mst0_rresp_o  ),
        .inport0_rid_o        (mst0_rid_o    ),
        .inport0_rlast_o      (mst0_rlast_o  ),
        .inport1_awready_o    (mst1_awready_o),
        .inport1_wready_o     (mst1_wready_o ),
        .inport1_bvalid_o     (mst1_bvalid_o ),
        .inport1_bresp_o      (mst1_bresp_o  ),
        .inport1_bid_o        (mst1_bid_o    ),
        .inport1_arready_o    (mst1_arready_o),
        .inport1_rvalid_o     (mst1_rvalid_o ),
        .inport1_rdata_o      (mst1_rdata_o  ),
        .inport1_rresp_o      (mst1_rresp_o  ),
        .inport1_rid_o        (mst1_rid_o    ),
        .inport1_rlast_o      (mst1_rlast_o  ),
        .inport2_awready_o    (mst2_awready_o),
        .inport2_wready_o     (mst2_wready_o ),
        .inport2_bvalid_o     (mst2_bvalid_o ),
        .inport2_bresp_o      (mst2_bresp_o  ),
        .inport2_bid_o        (mst2_bid_o    ),
        .inport2_arready_o    (mst2_arready_o),
        .inport2_rvalid_o     (mst2_rvalid_o ),
        .inport2_rdata_o      (mst2_rdata_o  ),
        .inport2_rresp_o      (mst2_rresp_o  ),
        .inport2_rid_o        (mst2_rid_o    ),
        .inport2_rlast_o      (mst2_rlast_o  ),
        .inport3_awready_o    (mst3_awready_o),
        .inport3_wready_o     (mst3_wready_o ),
        .inport3_bvalid_o     (mst3_bvalid_o ),
        .inport3_bresp_o      (mst3_bresp_o  ),
        .inport3_bid_o        (mst3_bid_o    ),
        .inport3_arready_o    (mst3_arready_o),
        .inport3_rvalid_o     (mst3_rvalid_o ),
        .inport3_rdata_o      (mst3_rdata_o  ),
        .inport3_rresp_o      (mst3_rresp_o  ),
        .inport3_rid_o        (mst3_rid_o    ),
        .inport3_rlast_o      (mst3_rlast_o  ),
        .outport_awvalid_o    (arb_awvalid_w ),
        .outport_awaddr_o     (arb_awaddr_w  ),
        .outport_awid_o       (arb_awid_w    ),
        .outport_awlen_o      (arb_awlen_w   ),
        .outport_awburst_o    (arb_awburst_w ),
        .outport_wvalid_o     (arb_wvalid_w  ),
        .outport_wdata_o      (arb_wdata_w   ),
        .outport_wstrb_o      (arb_wstrb_w   ),
        .outport_wlast_o      (arb_wlast_w   ),
        .outport_bready_o     (arb_bready_w  ),
        .outport_arvalid_o    (arb_arvalid_w ),
        .outport_araddr_o     (arb_araddr_w  ),
        .outport_arid_o       (arb_arid_w    ),
        .outport_arlen_o      (arb_arlen_w   ),
        .outport_arburst_o    (arb_arburst_w ),
        .outport_rready_o     (arb_rready_w  )
    );


    axi4_tap u_axi4_tap
    (
        // Inputs
        .clk                  (clk           ),
        .rst_n                (rst_n         ),
    
        .mst_awvalid_i        (arb_awvalid_w ),
        .mst_awaddr_i         (arb_awaddr_w  ),
        .mst_awid_i           (arb_awid_w    ),
        .mst_awlen_i          (arb_awlen_w   ),
        .mst_awburst_i        (arb_awburst_w ),
        .mst_wvalid_i         (arb_wvalid_w  ),
        .mst_wdata_i          (arb_wdata_w   ),
        .mst_wstrb_i          (arb_wstrb_w   ),
        .mst_wlast_i          (arb_wlast_w   ),
        .mst_bready_i         (arb_bready_w  ),
        .mst_arvalid_i        (arb_arvalid_w ),
        .mst_araddr_i         (arb_araddr_w  ),
        .mst_arid_i           (arb_arid_w    ),
        .mst_arlen_i          (arb_arlen_w   ),
        .mst_arburst_i        (arb_arburst_w ),
        .mst_rready_i         (arb_rready_w  ),
    
        .slv0_awready_i       (slv0_awready_i),
        .slv0_wready_i        (slv0_wready_i ),
        .slv0_bvalid_i        (slv0_bvalid_i ),
        .slv0_bresp_i         (slv0_bresp_i  ),
        .slv0_bid_i           (slv0_bid_i    ),
        .slv0_arready_i       (slv0_arready_i),
        .slv0_rvalid_i        (slv0_rvalid_i ),
        .slv0_rdata_i         (slv0_rdata_i  ),
        .slv0_rresp_i         (slv0_rresp_i  ),
        .slv0_rid_i           (slv0_rid_i    ),
        .slv0_rlast_i         (slv0_rlast_i  ),
    
        .slv1_awready_i       (slv1_awready_i),
        .slv1_wready_i        (slv1_wready_i ),
        .slv1_bvalid_i        (slv1_bvalid_i ),
        .slv1_bresp_i         (slv1_bresp_i  ),
        .slv1_bid_i           (slv1_bid_i    ),
        .slv1_arready_i       (slv1_arready_i),
        .slv1_rvalid_i        (slv1_rvalid_i ),
        .slv1_rdata_i         (slv1_rdata_i  ),
        .slv1_rresp_i         (slv1_rresp_i  ),
        .slv1_rid_i           (slv1_rid_i    ),
        .slv1_rlast_i         (slv1_rlast_i  ),
    
        .slv2_awready_i       (slv2_awready_i),
        .slv2_wready_i        (slv2_wready_i ),
        .slv2_bvalid_i        (slv2_bvalid_i ),
        .slv2_bresp_i         (slv2_bresp_i  ),
        .slv2_bid_i           (slv2_bid_i    ),
        .slv2_arready_i       (slv2_arready_i),
        .slv2_rvalid_i        (slv2_rvalid_i ),
        .slv2_rdata_i         (slv2_rdata_i  ),
        .slv2_rresp_i         (slv2_rresp_i  ),
        .slv2_rid_i           (slv2_rid_i    ),
        .slv2_rlast_i         (slv2_rlast_i  ),
    
        .slv3_awready_i       (slv3_awready_i),
        .slv3_wready_i        (slv3_wready_i ),
        .slv3_bvalid_i        (slv3_bvalid_i ),
        .slv3_bresp_i         (slv3_bresp_i  ),
        .slv3_bid_i           (slv3_bid_i    ),
        .slv3_arready_i       (slv3_arready_i),
        .slv3_rvalid_i        (slv3_rvalid_i ),
        .slv3_rdata_i         (slv3_rdata_i  ),
        .slv3_rresp_i         (slv3_rresp_i  ),
        .slv3_rid_i           (slv3_rid_i    ),
        .slv3_rlast_i         (slv3_rlast_i  ),
    
        .slv4_awready_i       (slv4_awready_i),
        .slv4_wready_i        (slv4_wready_i ),
        .slv4_bvalid_i        (slv4_bvalid_i ),
        .slv4_bresp_i         (slv4_bresp_i  ),
        .slv4_bid_i           (slv4_bid_i    ),
        .slv4_arready_i       (slv4_arready_i),
        .slv4_rvalid_i        (slv4_rvalid_i ),
        .slv4_rdata_i         (slv4_rdata_i  ),
        .slv4_rresp_i         (slv4_rresp_i  ),
        .slv4_rid_i           (slv4_rid_i    ),
        .slv4_rlast_i         (slv4_rlast_i  ),
    
        .slv5_awready_i       (slv5_awready_i),
        .slv5_wready_i        (slv5_wready_i ),
        .slv5_bvalid_i        (slv5_bvalid_i ),
        .slv5_bresp_i         (slv5_bresp_i  ),
        .slv5_bid_i           (slv5_bid_i    ),
        .slv5_arready_i       (slv5_arready_i),
        .slv5_rvalid_i        (slv5_rvalid_i ),
        .slv5_rdata_i         (slv5_rdata_i  ),
        .slv5_rresp_i         (slv5_rresp_i  ),
        .slv5_rid_i           (slv5_rid_i    ),
        .slv5_rlast_i         (slv5_rlast_i  ),
    
        // Outputs
        .mst_awready_o        (arb_awready_w ),
        .mst_wready_o         (arb_wready_w  ),
        .mst_bvalid_o         (arb_bvalid_w  ),
        .mst_bresp_o          (arb_bresp_w   ),
        .mst_bid_o            (arb_bid_w     ),
        .mst_arready_o        (arb_arready_w ),
        .mst_rvalid_o         (arb_rvalid_w  ),
        .mst_rdata_o          (arb_rdata_w   ),
        .mst_rresp_o          (arb_rresp_w   ),
        .mst_rid_o            (arb_rid_w     ),
        .mst_rlast_o          (arb_rlast_w   ),
    
        .slv0_awvalid_o       (slv0_awvalid_o),
        .slv0_awaddr_o        (slv0_awaddr_o ),
        .slv0_awid_o          (slv0_awid_o   ),
        .slv0_awlen_o         (slv0_awlen_o  ),
        .slv0_awburst_o       (slv0_awburst_o),
        .slv0_wvalid_o        (slv0_wvalid_o ),
        .slv0_wdata_o         (slv0_wdata_o  ),
        .slv0_wstrb_o         (slv0_wstrb_o  ),
        .slv0_wlast_o         (slv0_wlast_o  ),
        .slv0_bready_o        (slv0_bready_o ),
        .slv0_arvalid_o       (slv0_arvalid_o),
        .slv0_araddr_o        (slv0_araddr_o ),
        .slv0_arid_o          (slv0_arid_o   ),
        .slv0_arlen_o         (slv0_arlen_o  ),
        .slv0_arburst_o       (slv0_arburst_o),
        .slv0_rready_o        (slv0_rready_o ),
    
        .slv1_awvalid_o       (slv1_awvalid_o),
        .slv1_awaddr_o        (slv1_awaddr_o ),
        .slv1_awid_o          (slv1_awid_o   ),
        .slv1_awlen_o         (slv1_awlen_o  ),
        .slv1_awburst_o       (slv1_awburst_o),
        .slv1_wvalid_o        (slv1_wvalid_o ),
        .slv1_wdata_o         (slv1_wdata_o  ),
        .slv1_wstrb_o         (slv1_wstrb_o  ),
        .slv1_wlast_o         (slv1_wlast_o  ),
        .slv1_bready_o        (slv1_bready_o ),
        .slv1_arvalid_o       (slv1_arvalid_o),
        .slv1_araddr_o        (slv1_araddr_o ),
        .slv1_arid_o          (slv1_arid_o   ),
        .slv1_arlen_o         (slv1_arlen_o  ),
        .slv1_arburst_o       (slv1_arburst_o),
        .slv1_rready_o        (slv1_rready_o ),
    
        .slv2_awvalid_o       (slv2_awvalid_o),
        .slv2_awaddr_o        (slv2_awaddr_o ),
        .slv2_awid_o          (slv2_awid_o   ),
        .slv2_awlen_o         (slv2_awlen_o  ),
        .slv2_awburst_o       (slv2_awburst_o),
        .slv2_wvalid_o        (slv2_wvalid_o ),
        .slv2_wdata_o         (slv2_wdata_o  ),
        .slv2_wstrb_o         (slv2_wstrb_o  ),
        .slv2_wlast_o         (slv2_wlast_o  ),
        .slv2_bready_o        (slv2_bready_o ),
        .slv2_arvalid_o       (slv2_arvalid_o),
        .slv2_araddr_o        (slv2_araddr_o ),
        .slv2_arid_o          (slv2_arid_o   ),
        .slv2_arlen_o         (slv2_arlen_o  ),
        .slv2_arburst_o       (slv2_arburst_o),
        .slv2_rready_o        (slv2_rready_o ),
    
        .slv3_awvalid_o       (slv3_awvalid_o),
        .slv3_awaddr_o        (slv3_awaddr_o ),
        .slv3_awid_o          (slv3_awid_o   ),
        .slv3_awlen_o         (slv3_awlen_o  ),
        .slv3_awburst_o       (slv3_awburst_o),
        .slv3_wvalid_o        (slv3_wvalid_o ),
        .slv3_wdata_o         (slv3_wdata_o  ),
        .slv3_wstrb_o         (slv3_wstrb_o  ),
        .slv3_wlast_o         (slv3_wlast_o  ),
        .slv3_bready_o        (slv3_bready_o ),
        .slv3_arvalid_o       (slv3_arvalid_o),
        .slv3_araddr_o        (slv3_araddr_o ),
        .slv3_arid_o          (slv3_arid_o   ),
        .slv3_arlen_o         (slv3_arlen_o  ),
        .slv3_arburst_o       (slv3_arburst_o),
        .slv3_rready_o        (slv3_rready_o ),
    
        .slv4_awvalid_o       (slv4_awvalid_o),
        .slv4_awaddr_o        (slv4_awaddr_o ),
        .slv4_awid_o          (slv4_awid_o   ),
        .slv4_awlen_o         (slv4_awlen_o  ),
        .slv4_awburst_o       (slv4_awburst_o),
        .slv4_wvalid_o        (slv4_wvalid_o ),
        .slv4_wdata_o         (slv4_wdata_o  ),
        .slv4_wstrb_o         (slv4_wstrb_o  ),
        .slv4_wlast_o         (slv4_wlast_o  ),
        .slv4_bready_o        (slv4_bready_o ),
        .slv4_arvalid_o       (slv4_arvalid_o),
        .slv4_araddr_o        (slv4_araddr_o ),
        .slv4_arid_o          (slv4_arid_o   ),
        .slv4_arlen_o         (slv4_arlen_o  ),
        .slv4_arburst_o       (slv4_arburst_o),
        .slv4_rready_o        (slv4_rready_o ),
    
        .slv5_awvalid_o       (slv5_awvalid_o),
        .slv5_awaddr_o        (slv5_awaddr_o ),
        .slv5_awid_o          (slv5_awid_o   ),
        .slv5_awlen_o         (slv5_awlen_o  ),
        .slv5_awburst_o       (slv5_awburst_o),
        .slv5_wvalid_o        (slv5_wvalid_o ),
        .slv5_wdata_o         (slv5_wdata_o  ),
        .slv5_wstrb_o         (slv5_wstrb_o  ),
        .slv5_wlast_o         (slv5_wlast_o  ),
        .slv5_bready_o        (slv5_bready_o ),
        .slv5_arvalid_o       (slv5_arvalid_o),
        .slv5_araddr_o        (slv5_araddr_o ),
        .slv5_arid_o          (slv5_arid_o   ),
        .slv5_arlen_o         (slv5_arlen_o  ),
        .slv5_arburst_o       (slv5_arburst_o),
        .slv5_rready_o        (slv5_rready_o )
    );
    
endmodule
